package team.seekers.hula.common.entity.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum WindTypeEnum implements IEnum<Integer> {

    ADD_MEMORY(1,  "刻入一个记忆",1.0,1.0),
    ADD_POST(2,"发表一个帖子",1.0,1.0),
    ADD_ARTICLE(3,"发表一篇创作",1.0,1.0),
    ADD_COMMENT(4,  "提出一个问题",1.0,1.0),
    ADD_REPLAY(5, "回答一个问题",1.0,1.0),
    ADD_TALK(6, "发表一个箴言",1.0,1.0),
    FINISH_TODO_TEAM(7, "完成一个团队待办",0.0,0.0),
    FINISH_DECISION(8, "完成一个决策",0.0,0.0);

    private final int type;

    private final String name;

    private final Double hulaCoin;

    private final Double hulaScore;



    WindTypeEnum(int type, String name, Double hulaCoin , Double hulaScore) {
        this.type = type;
        this.name = name;
        this.hulaCoin = hulaCoin;
        this.hulaScore = hulaScore;
    }

    @Override
    public Integer getValue() {
        return this.type;
    }

    public static WindTypeEnum getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }

    public static WindTypeEnum getByName(String name) {
        return Arrays.stream(values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
